<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta name="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>${activity.title}</title>
<link rel="stylesheet" type="text/css"
	href="${ctx}/css/wx/public/reset.css">
<link rel="stylesheet" type="text/css"
	href="${ctx}/css/wx/public/font-awesome.css">
<link rel="stylesheet" type="text/css"
	href="${ctx}/css/wx/public/function.css">
<link rel="stylesheet" type="text/css" href="${ctx}/css/wx/style.css">

<script type="text/javascript"
	src="${ctx}/js/wx/model/jquery-1.8.0.min.js"></script>
<script type="text/javascript"
	src="${ctx}/js/wx/model/jquery.SuperSlide.2.1.1.source.js"></script>
<script type="text/javascript" src="${ctx}/js/wx/model/html5.js"></script>
<script type="text/javascript" src="${ctx}/js/wx/public.js"></script>
<script type="text/javascript" src="${ctx}/js/wx/app.js"></script>
<script type="text/javascript">
	//调用微信JS api 支付
	function jsApiCall() {
		WeixinJSBridge
				.invoke(
						'getBrandWCPayRequest',
						{
							"appId" : "${jsApiParameters.appId}", //公众号名称，由商户传入
							"timeStamp" : "${jsApiParameters.timeStamp}", //时间戳，自 1970 年以来的秒数
							"nonceStr" : "${jsApiParameters.nonceStr}", //随机串
							"package" : "${jsApiParameters.package_}",
							"signType" : "${jsApiParameters.signType}", //微信签名方式:
							"paySign" : "${jsApiParameters.paySign}" //微信签名
						},
						function(res) {
							if (res.err_msg == "get_brand_wcpay_request:ok") {
								window.location.href = "http://hql.tunnel.phpor.me/api/wx/licky.shtml?orderId=${orderId}";
							}
						});
	}

	function callpay() {
		if (typeof WeixinJSBridge == "undefined") {
			if (document.addEventListener) {
				document.addEventListener('WeixinJSBridgeReady', jsApiCall,
						false);
			} else if (document.attachEvent) {
				document.attachEvent('WeixinJSBridgeReady', jsApiCall);
				document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
			}
		} else {
			jsApiCall();
		}
	}
	function myzjjl() {
		window.location.href = "http://hql.tunnel.phpor.me/api/wxfrom/winuserlist.shtml";
	}
</script>

</head>
<body class="g-body-in">

	<div class="g-wrap">
		<section class="h15"></section>
		<section class="main-sec">
		<div class="einfo">
			<c:choose>
				<c:when test="${empty activity.imgpath}">
					<img src="${ctx}/images/wx/pic.jpg" width="100%">
				</c:when>
				<c:otherwise>
					<img src="${ctx}${activity.imgpath}" width="100%">
				</c:otherwise>
			</c:choose>
		</div>
		</section>

		<section class="main-sec"> <a href="#" onClick="callpay();"><div
				class="g-num">
				<h2>
					<em>点击进入抽奖</em>
				</h2>
			</div></a> </section>

		<section class="main-sec loptop">
		<div class="m-title">
			<h3>中奖名单</h3>
		</div>
		<dl class="peolist">
			<c:forEach items="${winuser}" var="win">
				<dd>
					<img src="${win.imgpath }" width="20%">
					<div class="right">
						<span><h2>${win.nickname}</h2> <em>${win.jpjs}</em></span>
						<p>奖品：${win.jp }</p>
						<p>
							<fmt:formatDate value="${win.createTime }"
								pattern="yyyy-MM-dd  HH:mm" />
						</p>
					</div>
				</dd>
			</c:forEach>

		</dl>

		</section>

		<script type="text/javascript">
			jQuery(".loptop").slide({
				mainCell : "dl",
				autoPage : true,
				effect : 'topLoop',
				autoPlay : true,
				scroll : 3,
				vis : 3,
				easing : 'swing',
				delayTime : 500,
				interTime : 3000,
				pnLoop : true
			});
		</script>
		<section class="main-sec"> <a href="#" onClick="myzjjl();"><div
				class="g-num">
				<h3>
					<em>我的中奖纪录</em>
				</h3>
			</div></a> </section>
		<section class="main-sec">
		<div class="m-title">
			<h3>活动说明</h3>
		</div>
		<div class="einfo">
			<p>
				活动时间：
				<fmt:formatDate value="${activity.startTime}"
					pattern="yyyy-MM-dd  HH:mm" />
				--
				<fmt:formatDate value="${activity.endTime}"
					pattern="yyyy-MM-dd  HH:mm" />
			</p>
			<p>活动介绍：${activity.content}</p>
		</div>
		</section>
	</div>



	<div class="dialog again">
		<div class="d-main">
			<p>支付失败！请先支付后开始抽奖！</p>
			<div class="btn-w">
				<a class="btn btn-lang close" href="javascript:void(0)"
					onClick="cancel(this)">取消</a>
			</div>
		</div>
	</div>
</body>
</html>